package com.report.enumeration;

public enum MergeTypeEnum {
    SUM(0, "合并"),
    DIFF(1, "差额"),
    HQ_SUM(2, "本部汇总");


    private int code;

    private String desc;

    private MergeTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static MergeTypeEnum getByCode(int code) {
        for (MergeTypeEnum value : values()) {
            if (value.code == code) {
                return value;
            }
        }
        return null;
    }

    public static MergeTypeEnum getByDesc(String desc) {
        for (MergeTypeEnum value : values()) {
            if (value.desc.equals(desc)) {
                return value;
            }
        }
        return null;
    }
}
